Skip to content

Misc modernize (pyupgrade)#99

Merged
inducer merged 3 commits into
inducer:mainfrom
alexfikl:pyupgrade-more
Mar 29, 2022
Merged

Misc modernize (pyupgrade)#99
inducer merged 3 commits into
inducer:mainfrom
alexfikl:pyupgrade-more

Conversation

@alexfikl

@alexfikl alexfikl commented Mar 6, 2022

Copy link
Copy Markdown
Collaborator

Noticed in #98 that there were still places that weren't using new-style super(), so ran pyupgrade over everything (again?).

The commits are nicer to look at separately.

@inducer

inducer commented Mar 6, 2022

Copy link
Copy Markdown
Owner

Thanks for this! @isuruf has a bunch of PRs pending against sumpy, and I feel like this might cause a healthy dose of conflicts. @isuruf, how do you feel about this?

@alexfikl

alexfikl commented Mar 6, 2022

Copy link
Copy Markdown
Collaborator Author

Thanks for this! @isuruf has a bunch of PRs pending against sumpy, and I feel like this might cause a healthy dose of conflicts. @isuruf, how do you feel about this?

I'm fine with letting this wait and rebasing later!

@isuruf

isuruf commented Mar 6, 2022

Copy link
Copy Markdown
Collaborator

Thanks. Let's wait until we get #95 in and I can rebase this. What were the options used for pyupgrade so that I can run this myself?

@alexfikl

alexfikl commented Mar 6, 2022

Copy link
Copy Markdown
Collaborator Author

Thanks. Let's wait until we get #95 in and I can rebase this.

Sounds good!

What were the options used for pyupgrade so that I can run this myself?

It's just pyupgrade --py36-plus, so something like

find . -name "*.py" -exec pyupgrade --py36-plus {} \;

with some caveats:

  • it turns tuple([...]) into just tuple(...) and those changes aren't included
  • it's very conservative with the f-strings, so the large majority of those in adf469f are done by hand.

@alexfikl alexfikl force-pushed the pyupgrade-more branch 2 times, most recently from 728ed9b to 77f4521 Compare March 28, 2022 14:47
@alexfikl

Copy link
Copy Markdown
Collaborator Author

@inducer Rebased this on main and fixed the conflicts, so it should be good for a look now.

@inducer inducer merged commit 53f8cda into inducer:main Mar 29, 2022
@inducer

inducer commented Mar 29, 2022

Copy link
Copy Markdown
Owner

Thanks!

@alexfikl alexfikl deleted the pyupgrade-more branch March 29, 2022 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants